/*
 *  ConcateParabola.cpp
 *  SoundController0002
 *
 *  Created by jiro on 10/06/28.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#include "ConcateParabola.h"
#include <cmath>

namespace sc 
{

	ConcateParabola::ConcateParabola()
		: Parabola( Type_ConcateParabola, 0, 0, 0, 0 )
	{}
	
	ConcateParabola::ConcateParabola( double startX, double startY, double endX, double endY )
		: Parabola( Line::Type_ConcateParabola, startX, startY, endX, endY )
	{
		if ( startY <= endY )
		{
			coefficientB = endX;
			coefficientC = endY;
			coefficientA = ( startY - coefficientC ) / pow( ( startX - coefficientB ), 2.0 );
		}
		else 
		{
			coefficientB = startX;
			coefficientC = startY;
			coefficientA = ( endY - coefficientC ) / pow( ( endX - coefficientB ), 2.0 );
		}
	}

	ConcateParabola::~ConcateParabola()
	{}

}